//
//  XTextField.m
//  iAccountBook
//
//  Created by 侯伟 on 2021/9/7.
//

#import "XTextField.h"

@interface XTextField ()<UITextFieldDelegate>

@end

@implementation XTextField

- (instancetype)init{
    if(self = [super init]){
        
        self.myHeight = PX(44);
        self.padding = UIEdgeInsetsMake(0, 8, 0, 8);
        self.layer.cornerRadius = PX(5);
        self.layer.masksToBounds = YES;
        self.backgroundColor = UIColor.whiteColor;
        
        UITextField* textField = [[UITextField alloc] init];
        textField.backgroundColor = UIColor.whiteColor;
        textField.borderStyle = UITextBorderStyleNone;
        textField.tintColor = COLOR_THEME_A;
        textField.font = FONT_FIT(14);
        textField.delegate = self;
        textField.myMargin = 0;
        [self addSubview:textField];
        _textField = textField;
    }
    return self;
}

#pragma mark -- UITextFieldDelegate
//监听return 键的点击
- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    return YES;
    
}
@end
